<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引包 -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
       
        <button @click="  getMessage(666) ">点击我传递参数---传递一个参数</button>
       
        <button @click="  getMessage1(110,'我爱你') ">点击我传递参数-两个参数</button>

        <button @click=" getMessage2($event,12306,'喜欢张杰') ">点击我传递多个参数</button>
        <hr>
       
        <button @click=" getMessage3">event获取注意事项</button>
    </div>
</body>

</html>
<script>
    const VM = new Vue({
        el: '#app',
        methods: {
            getMessage(params) {
                console.log(params);
            },
            getMessage1(param1, param2) {
                console.log(param1, param2);
            },
            getMessage2(e, param1, param2) {
                console.log(param1, param2);
                console.log(e);
            },
            getMessage3(e) {
                console.log(e);
            }
        }
    })
</script>